package core.manager.playerManager
{
    import core.manager.playerManager.flvPlayerManager.*;
    import core.manager.playerManager.musicPlayerManager.*;
    import core.manager.playerManager.swfManager.*;
    import flash.events.*;

    public class PlayerManager extends EventDispatcher
    {
        private static var _instance:PlayerManager;

        public function PlayerManager()
        {
            if (_instance == null)
            {
                _instance = this;
            }
            else
            {
                throw new Error("PlayerManager不能被实例化.");
            }
            return;
        }// end function

        public function init() : void
        {
            SwfManager.getInstance().init();
            FlvPlayerManager.getInstance().init();
            return;
        }// end function

        public function getSwfManager() : SwfManager
        {
            return SwfManager.getInstance();
        }// end function

        public function showFlvById(invalidatePropertiesQueue:String) : Boolean
        {
            return FlvPlayerManager.getInstance().showFlvById(invalidatePropertiesQueue);
        }// end function

        public function getBackgroundMusicManager() : BackGroundMusicManager
        {
            return BackGroundMusicManager.getInstance();
        }// end function

        public function removeFlvById(invalidatePropertiesQueue:String) : Boolean
        {
            return FlvPlayerManager.getInstance().removeFlvById(invalidatePropertiesQueue);
        }// end function

        public function getCustomMusicManager() : CustomMusicManager
        {
            return CustomMusicManager.getInstance();
        }// end function

        public static function getInstance() : PlayerManager
        {
            if (_instance == null)
            {
                return new PlayerManager;
            }
            return _instance;
        }// end function

    }
}
